<?php

namespace App\Http\Requests\OperationManagement;

use Illuminate\Foundation\Http\FormRequest;
use App\Http\Requests\BaseRequest;

class JobScopeRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'road_name' => 'required',
            'road_level' => 'required',
            'type' => 'required|integer',
            'area_id' => 'required|integer',
            'road_origin' => 'required',
            'road_destination' => 'required',
            'road_length' => 'required',
            'road_width' => 'required',
            'motor_length' => 'required',
            'motor_width' => 'required',
            'non-motor_length' => 'required',
            'non-motor_width' => 'required',
            'sidewalk_length' => 'required',
            'sidewalk_width' => 'required',
            'road_areas' => 'required',
            // 'machine_task' => 'required',
            // 'watering' => 'required',
            // 'sidewalk' => 'required',
            // 'dustfall' => 'required',
            'mode' => 'required'
        ];
    }

    public function messages() 
    {
        return [
            'road_name.required' => '道路名称不能为空',
            'road_level.required' => '道路等级不能为空',
            'type.required' => '幅路类型不能为空',
            'type.integer' => '幅路类型只能填写数字',
            'area_id.required' => '城市id不能为空',
            'area_id.integer' => '城市id只能填写数字',
            'road_origin.required' => '起点不能为空',
            'road_destination.required' => '终点不能为空',
            'road_length.required' => '道路长度不能为空',
            'road_width.required' => '道路宽度不能为空',
            'motor_length.required' => '机动车道长度不能为空',
            'motor_width.required' => '机动车道宽度不能为空',
            'non-motor_length.required' => '非机动车道长度不能为空',
            'non-motor_width.required' => '非机动车道宽度不能为空',
            'sidewalk_length.required' => '人行道长度不能为空',
            'sidewalk_width.required' => '人行道宽度不能为空',
            'road_areas.required' => '作业面积不能为空',
            // 'machine_task.required' => '机扫任务量不能为空',
            // 'watering.required' => '洒水任务量不能为空',
            // 'sidewalk.required' => '人行道养护不能为空',
            // 'dustfall.required' => '炮雾车/降尘不能为空',
            'mode.required' => '清扫模式不能为空'
        ];
    }

}
